; check function to see if it is an MD or RD function
cmp ah,39h ; check to see if it is MD
je beep ; it's MD so redefine function to be a beep
cmp ah,3ah ; check to see if it is RD
jne dos_exit ; it's not RD or MD so don't touch
beep:
mov ah,02 ; replace function with function to beep
mov dl,07
dos_exit:
jmp old_dos ; call the old dos routine
tsr_end db 0 ; marks the end of the TSR resident portion
; TSR Transient portion
install:
; get old ISR address for interrupt 21h
mov ax,3521h
int 21h
mov cs:[old_dos_off],bx ; store ISR address in jump statement
mov cs:[old_dos_seg],es
; install new DOS ISR
xor ax,ax ; zero ES register
mov es,ax
mov dx,offset new_dos ; point to start of program
cli
mov word ptr es:[84],dx ; update vector offset
mov word ptr es:[86],cs ; update vector segment
sti
; free memory used by environment block
mov ah,62h ; get address of PSP
int 21h
mov es,bx ; get address of environment block from PSP
mov bx,word ptr es:[2ch]
mov es,bx ; free environment block
mov ah,49h
int 21h
; display message
push cs ; point ds at code segment
pop ds
mov dx,offset message ; point to message
mov ah,9
int 21h ; display message
; TSR !
mov dx,offset tsr_end ; length of resident portion
int 27h
message db 0ah,0dh,'NO_MD_RD.COM Copyright (C) 1993 by Rafe Aldridge.',0ah,0dh,'The DOS functions to make and remove directories have been disabled.',0ah,0dh,24h